Executes javascript for each row. The js is expected to transform or aggregate incoming data, probably holding stateful information between calls to writeRow. Output will be generted from the js by calling writeRow(..) Script context variables:

  • pipeline - a Pipeline object
  • thisStep - also a referene to the current Pipeline
  • formatter - the Formatter
  • nextStep - a NextStep object, representing the next step to be executed after the current
  • log - the logger for generating console log output
  • applications - an Applications object, use it to reference other apps and their services, eg applications.search.searchManager.search(...)
  • fileManager - a FileManager object
Here's a fairly common example:
 <RecordExecutionStep>
 <preventDuplicates>false</preventDuplicates>
 <execIdTemplate>StarClass-Dealer-Targets_2015</execIdTemplate>
 <next class="TransactionStep"
 alwaysRollback="false"> <next
 class="ExcelInputStep"> <useXml>true</useXml>
 <processRows>true</processRows> <nextSheetSteps>
 <NextSheetStep sheetNum="0" startRow="2">
  <next class="JsRowStep"> <!-- Execute the next
 step for each month, setting the month number into attribute monthNum -->
 <jsPath>/integration/integration.js</jsPath>
 <execFn>foreachMonth</execFn>     
 <next class="SalesDataInserter" mode="updateOrInsert"
 logInserts="true" logUpdates="true">
 <seriesName>star-class-partspurchase-data</seriesName> <column
 field="attributedTo" columnName="D"> <expr> org
 = pipeline.thisOrg.findChildOrgByField("StoreCode", value); if(org
 != null){ return org.orgId; } return null; </expr> </column>
 <column field="amount" > <!-- column G + 10*month -->
 <expr><![CDATA[ col = 2 +
 formatter.toInteger(pipeline.attributes.monthNum); if (0 >= row[col]) {
 return 1; } else { return row[col]; } ]]></expr> </column>

 <column field="fromDate">
 <expr>formatter.monthStart(formatter.now,
 pipeline.attributes.monthNum)</expr> </column> <column
 field="toDate"> <expr>formatter.monthEnd(formatter.now,
 pipeline.attributes.monthNum)</expr> </column> </next>

 </next> </NextSheetStep> </nextSheetSteps> </next>
 </next> </RecordExecutionStep>


Properties

Name Returns Notes Example
jsPath String
jsText String
execFn String
finishFn String
prepareFn String
next PipelineStep

Ask a question, or offer an answer